<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<%@ page import="java.util.Calendar, com.scalar.chiptrack.utils.ConfigManager"%>

<chiptrack:checkLogon sourcePage="/financeReport.do?action=sortdetails" />
<%
 String productId    = request.getParameter("products");
if( productId == null || ( productId != null && productId.trim().length() == 0 ) )
    {
        productId = "0";
    }
%>

<HTML>
<HEAD>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></SCRIPT>
<script>
var dateElement = "";

function openCalendar(dateValue)
{
        dateElement = dateValue;
        newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
        newWindow.moveTo(550,180);
        newWindow.focus();
}
function assignDate(passedValue)
{
        dateElement.value=passedValue;
        window.focus();
}

function finance(){

    var d = new Date();
    var day = d.getDate();
    var month = d.getMonth()+1;
    var year = d.getFullYear();
    var hour = d.getHours();
    var min = d.getMinutes();
    var sec = d.getSeconds();

    var defaultPrompt = day+"/"+month+"/"+year+":"+hour+":"+min+":"+sec;
    
    if (document.sortdetailsreport.products.value == null || document.sortdetailsreport.products.value =='')
        document.sortdetailsreport.prompt0.value='0';
    else
        document.sortdetailsreport.prompt0.value = document.sortdetailsreport.products.value;

    document.sortdetailsreport.prompt1.value = document.sortdetailsreport.quarter.value;
    if (document.sortdetailsreport.year.value == '')
        document.sortdetailsreport.prompt2.value='0';
    else
        document.sortdetailsreport.prompt2.value = document.sortdetailsreport.year.value;
        document.sortdetailsreport.prompt3.value =defaultPrompt;
	    document.sortdetailsreport.prompt4.value ='';
	    document.sortdetailsreport.prompt5.value ='';
	    document.sortdetailsreport.prompt6.value ='';
	    document.sortdetailsreport.prompt7.value ='';
	    document.sortdetailsreport.prompt8.value ='';
	    document.sortdetailsreport.prompt9.value ='';
	    document.sortdetailsreport.prompt10.value ='';

    document.sortdetailsreport.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Operations/WAFERS_SORTED_DETAILS.rpt";  
    document.sortdetailsreport.submit();

    return true;
}


</script>
<TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<form name="sortdetailsreport" method="post">
<input type="hidden" name="prompt0">
<input type="hidden" name="prompt1">
<input type="hidden" name="prompt2">
<input type="hidden" name="prompt3">
<input type="hidden" name="prompt4">
<input type="hidden" name="prompt5">
<input type="hidden" name="prompt6">
<input type="hidden" name="prompt7">
<input type="hidden" name="prompt8">
<input type="hidden" name="prompt9">
<input type="hidden" name="prompt10">

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" align ="center" border="0">
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->
<%@ include file="/jsp/operations/reports_side_menu.jsp" %>
<!-- end of the side navigations -->
<TD bgcolor="#ffffff">
<IMG height=9 src="images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<!-- from here your body starts -->
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>
  <table border="0" width="90%" align=right>
    <tr>
        <td colspan=1><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>&nbsp;</td>
        <td colspan=4><span class="NArialW">Wafers Sorted Details Report</span></td>
        <td colspan=1><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>&nbsp;</td>
    </tr>
    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
    <tr>
        <td colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10>
        <b><font face="NArialL" size="-5" align="center" color="#ff0000" id="errors"></font><b>
        </td>
    </tr>
 	<tr>
 		<TD width="20%">&nbsp;</TD>
        <td width="15%"><font class="NArialL">Product</font></td>
        <td width="55%"><font class="NArialL">
           <select size="1" name="products" class="txfield">
            <option value="0">All Products</option>
            <logic:iterate id="mktgPartNumberSelectList" name="productList" >
            	<logic:notEqual name="mktgPartNumberSelectList" property="value" value="<%=productId%>">
                    <option value="<bean:write name="mktgPartNumberSelectList" property="value"/>" >
                        <bean:write name="mktgPartNumberSelectList" property="label"/>
                    </option>
                </logic:notEqual>
            </logic:iterate>
        </select>
        </td>
        <TD width="10%">&nbsp;</TD>        
    </tr>
    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
    <tr>
      <TD width="20%">&nbsp;</TD>
      <td width="15%"><font class="NArialL">Year </font></td>
      <td width="55%">
      <table border="0" width="90%" align=left>
      <tr>
      <td width="20%"><font class="NArialL" align="left">
           <html:select name="year" property="year" styleClass="txfield" value='<%=Integer.toString(Calendar.getInstance().get (Calendar.YEAR))%>'>
           <html:options collection="years" property="value" labelProperty="label" />
        </html:select>
      <td width="21%"><font class="NArialL">Quarter&nbsp;</font></td>
      <td width="32%"><font class="NArialL">
	  <select name="quarter" class="txfield">
          <% String currentQtr = (String) request.getAttribute("currentQtr"); %>
           <logic:iterate id="quarterList" name="quarterList">
        	    <logic:notEqual name="quarterList" value="null">
                    <logic:equal name="quarterList" property="value" value="<%=currentQtr%>">
                        <option value = "<bean:write name="quarterList" property="value"/>" SELECTED>
                            <bean:write name="quarterList" property="label"/>
                        </option>
                    </logic:equal>
                    <logic:notEqual name="quarterList" property="value" value="<%=currentQtr%>">
                        <option value = "<bean:write name="quarterList" property="value"/>" >
                            <bean:write name="quarterList" property="label"/>
                        </option>
                    </logic:notEqual>
                </logic:notEqual>
            </logic:iterate>
        </select>
        <tr>
        </table>
      </td>
      <td width="20%">&nbsp;</td>
    </tr>
   <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
   <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
          
      <td colspan=3 align=center>
	  <input type="image" onClick="javascript:return finance();"  border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17" onmouseover="window.status='Click to Generate Revenue Report';return true"onmouseout="window.status='';return true"title="Click here to Generate Revenue Report">
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="javascript:document.sortdetailsreport.reset();"><img src="<%=chipTracContext%>/jsp/includes/images/reset.gif" border='0' onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true"title="Click here to Reset"></a>
      </td>
      <td colspan=1><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10>&nbsp;</td>
    </tr>

  </table>


<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</form>
</BODY>
</HTML>
